home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / art&graf.ix / art-3139 / boot_pic.mug / boot_tn1.s < prev    next >
Text File  |  1987-04-21  |  4KB  |  184 lines

  1. ;
  2. ; TINY '.TN1' Picture Booter v1.0
  3. ; --------------------------------
  4. ;
  5. ; Coded by:       Mike Mee (although header credits MUG U.K !!)
  6. ; Tiny Depack by: Axe of Delight
  7. ;
  8. ; v1.0 - Adapted from NeoChrome Booter v2.0 from PVK v2.1
  9. ;
  10.  
  11. pic_adr    equ    $20000
  12. buffer    equ    $27d00
  13.  
  14. yes    equ    1
  15. no    equ    0
  16.  
  17. text_on    equ    yes    ; no = saving of 12 bytes + length of text
  18.  
  19.     opt    p+,o+,d-,s-
  20.  
  21.     bra.s    start
  22.     dc.b    "Coded by: MUG U.K",191," 15/10/1991",0
  23.  
  24. start    
  25.     ifne    text_on
  26.     pea    text(pc) 
  27.     move.w    #9,-(a7)
  28.     trap    #1
  29.     addq.w    #6,a7
  30.     endc
  31.  
  32.     lea    filename(pc),a0    ; file to load
  33.     move.l    #pic_adr-34,d6    ; destination address
  34.     move.l    #3410,d7         ; length = ????? bytes (ALTER !!)
  35.  
  36. loadit    lea    handle(pc),a6    
  37.     clr.w    -(a7)         ; mode = 0 (open to read)
  38.     move.l    a0,-(a7)        ; filename to open
  39.     move.w    #$3d,-(a7)    ; f_open
  40.     trap    #1        ; do it !!
  41.     addq.l    #8,a7        ; tidy stack
  42.     move.w    d0,(a6)         ; store file handle returned
  43.  
  44.     move.l    d6,-(a7)        ; address to load to
  45.     move.l    d7,-(a7)        ; amount to read in
  46.     move.w    d0,-(a7)        ; file handle
  47.     move.w    #$3f,-(a7)    ; f_read
  48.     trap    #1        ; do it
  49.     adda.l    #$c,a7        ; tidy stack
  50.  
  51.     move.w    (a6),-(a7)    ; file handle
  52.     move.w    #$3e,-(a7)    ; f_close
  53.     trap    #1        ; do it !!
  54.     addq.l    #4,a7        ; tidy stack
  55.  
  56.     lea    pic_adr-34,a0
  57.     lea    buffer,a1
  58.     bsr.s    tiny
  59.  
  60.     lea    tinpal(pc),a0    ; pictures palette
  61.     lea    $ffff8240.W,a1    ; ST palette
  62.     movem.l    (a0),d0-d7    ; move from one
  63.     movem.l    d0-d7,(a1)    ; to the other
  64.  
  65.     move.l    $44e.w,a0        ; current screen address
  66.     lea    buffer,A1    ; source
  67.     move.w    #$1F3F,D0        ; (32000/4)-1 = $1F3F (7999)
  68. bmove    move.l    (A1)+,(A0)+    ; move it
  69.     dbf    d0,bmove        ; loop
  70.  
  71. exit    rts            ; bye bye
  72.  
  73. filename    dc.b    '\source.tn1',0    ; don't use a: for those that
  74.                 ; have to boot from drive b: !!
  75.  
  76.     ifne    text_on
  77. text    dc.b    $1B,'E'
  78.     dc.b    'Picture Loading !!',0
  79.     endc
  80.  
  81. ; Source for unpacking Tiny-pictures - Written by Axe of Delight
  82. ; Assemble with Devpac 2.08, Tab-position: 10
  83. ; You need source (packed tiny screen) and destination (screen address)
  84. ; for unpacking. After unpacking, the palette is saved at tinpal.
  85.  
  86. ;    lea    source,a0    ; source
  87. ;    lea    destination,a1    ; destination
  88. ;    bsr    tiny
  89.  
  90. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  91. tiny:    movem.l    d1-d6/a2-a5,-(sp)
  92.     bsr    t_getpal        ; read resolution and palette
  93.     move.l    a4,d5
  94.     move.l    a1,d6
  95.     add.l    #$7d00,d6
  96.     move.l    a1,d4
  97.     add.l    #$a0,d4
  98.     bra.s    t17a0a
  99. t179be:    moveq    #0,d0
  100.     move.b    (a5)+,d0
  101.     beq.s    t179ce
  102.     cmp.b    #1,d0
  103.     beq.s    t179d6
  104.     ext.w    d0
  105.     bra.s    t179de
  106. t179ce:    move.b    (a5)+,d0
  107.     lsl.w    #8,d0
  108.     move.b    (a5)+,d0
  109.     bra.s    t179de
  110. t179d6:    move.b    (a5)+,d0
  111.     lsl.w    #8,d0
  112.     move.b    (a5)+,d0
  113.     neg.w    d0
  114. t179de:    tst.w    d0
  115.     bmi.s    t179ea
  116.     move.b    (a4)+,d3
  117.     lsl.w    #8,d3
  118.     move.b    (a4)+,d3
  119.     bra.s    t17a2e
  120. t179ea:    neg.w    d0
  121.     bra.s    t17a06
  122. t179ee:    move.b    (a4)+,(a1)+
  123.     move.b    (a4)+,(a1)+
  124.     lea    $9e(a1),a1
  125.     cmp.l    d6,a1
  126.     blt.s    t17a06
  127.     lea    $ffff8308(a1),a1
  128.     cmp.l    d4,a1
  129.     blt.s    t17a06
  130.     lea    $ffffff62(a1),a1
  131. t17a06:    dbf    d0,t179ee
  132. t17a0a:    cmp.l    d5,a5
  133.     blt.s    t179be
  134.     moveq    #1,d0
  135. t_end:    movem.l    (sp)+,d1-d6/a2-a5
  136.     rts
  137. t17a18:    move.w    d3,(a1)+
  138.     lea    $9e(a1),a1
  139.     cmp.l    d6,a1
  140.     blt.s    t17a2e
  141.     lea    $ffff8308(a1),a1
  142.     cmp.l    d4,a1
  143.     blt.s    t17a2e
  144.     lea    $ffffff62(a1),a1
  145. t17a2e:    dbf    d0,t17a18
  146.     cmp.l    d5,a5
  147.     blt.s    t179be
  148.     moveq    #1,d0
  149.     movem.l    (sp)+,d1-d6/a2-a5
  150.     rts
  151.  
  152. t_getpal: cmpi.b    #2,(a0)+        ; Color mode?
  153.     ble.s    t_color
  154.     addq.l    #4,a0
  155. t_color:    moveq    #31,d0        ; install palette
  156.     lea    tinpal(pc),a2
  157. t_copypal:move.b    (a0)+,(a2)+
  158.     dbra    d0,t_copypal
  159.     move.b    (a0)+,d1
  160.     lsl.w    #8,d1
  161.     move.b    (a0)+,d1
  162.     addq.l    #2,a0
  163.     movea.l    a0,a5        ; beginning of Data
  164.     ext.l    d1
  165.     adda.l    d1,a0
  166.     movea.l    a0,a4        ; end of Data
  167.     moveq    #1,d0
  168.     rts
  169.  
  170. tinpal:    ds.w 16
  171.  
  172. handle    ds.w    1
  173.  
  174. ;
  175. ; Alter length of 'blanks' to ensure length of bootsector is equal
  176. ; to 480 bytes !!
  177. ;
  178.     ifne    text_on
  179. blanks    ds.w    30    ; amount when text function is on
  180.     elseif
  181.     ds.w    47    ; and when it's off !!
  182.     endc
  183.  
  184.